package com.fulihui.common.error;

/**
 * @author: Levon
 * @version: v 0.1 2018-06-06 17:06
 */
public class InvokeServiceException extends RuntimeException {

    private static final long serialVersionUID = 5904599239944011613L;
    
    private int errcode;
    private String errmsg;

    public InvokeServiceException(int errcode, String errmsg) {
        super(errmsg);
        this.errcode = errcode;
        this.errmsg = errmsg;
    }

    public InvokeServiceException(int errcode, String errmsg, Throwable cause) {
        super(errmsg, cause);
        this.errcode = errcode;
        this.errmsg = errmsg;
    }

    public InvokeServiceException(ServiceError error) {
        super(error.getErrmsg());
        this.errcode = error.getErrcode();
        this.errmsg = error.getErrmsg();
    }

    public InvokeServiceException(ServiceError error, Throwable cause) {
        super(error.getErrmsg(), cause);
        this.errcode = error.getErrcode();
        this.errmsg = error.getErrmsg();
    }

    public int getErrcode() {
        return errcode;
    }

    public String getErrmsg() {
        return errmsg;
    }
}
